#!/bin/bash
if [ $1 ]; then
export QUERY_STRING='GSM.RRLP.ACCURACY=7&GSM.RRLP.RESPONSETIME=4&GSM.RRLP.ALMANAC.URL=687474703a2f2f7777772e6e617663656e2e757363672e676f762f3f706167654e616d653d63757272656e74416c6d616e616326666f726d61743d79756d61&GSM.RRLP.EPHEMERIS.URL=6674703a2f2f6674702e7472696d626c652e636f6d2f7075622f6570682f437572526e784e2e6e6176&GSM.RRLP.ALMANAC.REFRESH.TIME=24.0&GSM.RRLP.EPHEMERIS.REFRESH.TIME=1.0&GSM.RRLP.SEED.LATITUDE=37.8720708&GSM.RRLP.SEED.LONGITUDE=-122.2578337&GSM.RRLP.SEED.ALTITUDE=0&GSM.RRLP.ALMANAC.ASSIST.PRESENT=0&GSM.RRLP.EPHEMERIS.ASSIST.COUNT=6&query='$1
./rrlpserver.cgi
else
echo "./rrfake [testlled,loc,assist,testpos]"
fi

# This tests to see if the erlang RRLP server is functioning, independent of
# the CGI web script
# First try
# 	./rrfake testlled
# That verifies that the erlang stuff is running.
# If it doesn't work, perhaps you didn't compile.  Or don't have erlang.
# 
# Then you can try
# 	./rrfake loc
# 	./rrfake assist
# 	./rrfake testpos
# These all depend on reading the ephemeris.
# If it doesn't work, perhaps you don't have a writable /var/run/rrlp where it caches the ephemeris.
